var mySwiper = new Swiper('.swiper-container', {
  simulateTouch: false,//禁止鼠标模拟
  autoplay: true, // 自动轮播
  autoplay: {
    delay: 5000,
    stopOnLastSlide: false,
    disableOnInteraction: false,
  },
  loop: true, // 循环模式选项

  // 如果需要分页器
  pagination: {
    el: '.swiper-pagination',
  },
})
$('.li').click(function () {
  $(this).toggleClass('active').find('ol').slideToggle(300)
  $(this).siblings().removeClass('active').find('ol').slideUp(300)
})
$('.lli').click(function () {
  $(this).find('ul').slideToggle(300)
  $(this).siblings().find('ul').slideUp(300)
})
$('.bgcode').mouseenter(function () {
  $('.code').toggleClass('active')
})
$('.bgcode').mouseleave(function () {
  $('.code').toggleClass('active')
})
const login = document.querySelector('.login')
const rlogin = document.querySelector('.rlogin')
const exit = document.querySelector('.exit')
const onelogin = document.querySelector('#onelogin')
const twologin = document.querySelector('#twologin')
const id = window.localStorage.getItem('id')
const phone = window.localStorage.getItem('phone')
authentication()
function authentication() {
  console.log(id)
  if (!id) {
    twologin.style.display = 'none'
    onelogin.style.display = 'block'
    return
  }else {
    onelogin.style.display = 'none'
    twologin.style.display = 'block'
    rlogin.innerText = `欢迎 ${phone} 回来`
    exit.innerText = '退出'
  }
}

exit.addEventListener('click', () => {
  window.localStorage.removeItem('id')
  window.localStorage.removeItem('phone')
  window.location.reload()
  
})

